{include file="public/header" /}
<style>
body{
    background: #FFF;
}
 .page{
     min-height: auto;
 }
</style>
<div class="page">
<form method="post" name="remark_form" id="remark_form">
       <br/>
       <br/>
       <span><a href="javascript:void(0);" class="dsui-btn-edit" id='pi_ids' style="float:right; margin: 23px 55px 2px 0;padding: 0px 17px;height: 31px;line-height: 31px;"><i class="iconfont"></i>批量操作</a></span>
       <br/>
       <br/>
       <br/>
    <table class="ds-default-table nobdb">
            <tr>
                <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
                <td style="width: 500px;"><label>商品名及规格值</label></td>
                <td style="width: 300px;"><label>教程名称</label></td>
                <td><label>操作</label></td>
            </tr>
            <?php foreach($goods_info as $k=>$v){?>
            <tr>
                <td><input type="checkbox" value="{$v.goods_id}" class="checkitem"></td>
                <td ><?php echo $v['goods_name']; ?></td>
                <td><label><?php if(empty($v['course_name'])){ echo '未设置';}else{ echo $v['course_name']; } ?></label></td>
                <td><a href="javascript:void(0);" onclick="setting_course({$v['goods_id']});" class="dsui-btn-edit"><i class="iconfont"></i>设置教程</a></td>
            </tr>
            <?php }?>
        </table>
</form></div>
<script>


    //商品设置平台价格
    function setting_course(ids_str) {
      _uri = ADMINSITEURL+"/Product/setting_course?goods_id=" + ids_str;
        dsLayerOpen(_uri,'设置教程','610px','410px');
    }

    // 批量处理
    $('a[id="pi_ids"]').click(function(){
        ids_str = getItems();
        /*alert(ids_str);return false;*/
        if (ids_str) {
            setting_course(ids_str);
        }
    });

    // 获得选中ID
    function getItems() {
        /* 获取选中的项 */
        var items = '';
        $('.checkitem:checked').each(function () {
            items += this.value + ',';
        });
        if (items != '') {
            items = items.substr(0, (items.length - 1));
        }else{
            layer.alert('{$Think.lang.please_select_input}', {icon: 2})  
        }
        return items;
    }




    
</script>